#pragma once
#include "libs.cpp"
#include "compile_string.cpp"
#include "types.cpp"

namespace json {
    namespace detail {
        using NumberType = JSON_MAKE_STRING("number");
        using StringType = JSON_MAKE_STRING("string");
        template <compile_string S>
        struct parse_impl {
            using type = std::conditional_t<
                NumberType::equals<S>, 
                types::number, 
                std::conditional_t<
                    StringType::equals<S>, 
                    types::string, 
                    int
                >
            >;
            static_assert(!std::is_same_v<type, int>, "json syntax error");
        };
        template <compile_string S>
        using parse = parse_impl<S>::type;

    }
};
